package com.usian.user.controller.v1;

import com.usian.apis.user.ApUserControllerApi;
import com.usian.model.article.dtos.ApUserDto;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import com.usian.model.user.dtos.UserRelationDto;
import com.usian.model.user.pojos.ApUser;
import com.usian.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.ws.rs.GET;


/**
 * ClassName: ApUserController
 * Author:   WGG
 * Date:    2022-11-2022/11/30-11:17
 * Version: 1.0
 * Description:
 */
@RestController
@RequestMapping("/user/api/v1/user")
public class ApUserController implements ApUserControllerApi {

    @Autowired
    private ApUserService apUserService;


    @Override
    @PostMapping("/user_follow")
    public ResponseResult userFollow(@RequestBody UserRelationDto dto) {
        return apUserService.userFollow(dto);
    }

    @Override
    @GetMapping("/findById/{id}")
    public ApUser findById(@PathVariable("id") Long id) {
        return apUserService.findById(id);
    }

}

